package cn.coco.jf.fw.api.config;

import com.alibaba.fastjson.JSONObject;
import com.jfinal.render.JsonRender;
import com.jfinal.render.Render;
import com.jfinal.render.RenderFactory;

public class JkapiRenderFactory extends RenderFactory {

    @Override
    public Render getErrorRender(int errorCode) {
        if(errorCode == 404){
            JSONObject json = new JSONObject();
             json.put("code", 404);
             json.put("msg", "请求路径不存在!");
             return new JsonRender(json);
        }
        return super.getErrorRender(errorCode);
    }
    

}
